/*    */ package com.zimbra.cs.html;
/*    */ 
/*    */ import java.io.IOException;
/*    */ import java.io.InputStream;
/*    */ import java.io.Reader;
/*    */ import java.io.Writer;
/*    */ import javax.xml.parsers.ParserConfigurationException;
/*    */ import javax.xml.parsers.SAXParser;
/*    */ import javax.xml.parsers.SAXParserFactory;
/*    */ import org.xml.sax.InputSource;
/*    */ import org.xml.sax.SAXException;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class XHtmlDefang
/*    */   extends AbstractDefang
/*    */ {
/*    */   public void defang(InputStream is, boolean neuterImages, Writer out)
/*    */     throws IOException
/*    */   {
/* 41 */     InputSource inputSource = new InputSource(is);
/* 42 */     defang(inputSource, neuterImages, out);
/*    */   }
/*    */   
/*    */   public void defang(Reader reader, boolean neuterImages, Writer out)
/*    */     throws IOException
/*    */   {
/* 48 */     InputSource inputSource = new InputSource(reader);
/* 49 */     defang(inputSource, neuterImages, out);
/*    */   }
/*    */   
/*    */   protected void defang(InputSource is, boolean neuterImages, Writer out)
/*    */     throws IOException
/*    */   {
/* 55 */     SAXParserFactory spf = SAXParserFactory.newInstance();
/*    */     try {
/* 57 */       spf.setFeature("http://xml.org/sax/features/external-general-entities", false);
/* 58 */       spf.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
/*    */       
/* 60 */       SAXParser sp = spf.newSAXParser();
/*    */       
/* 62 */       XHtmlDocumentHandler handler = new XHtmlDocumentHandler(out);
/*    */       
/* 64 */       sp.parse(is, handler);
/*    */     }
/*    */     catch (SAXException se) {
/* 67 */       se.printStackTrace();
/*    */     } catch (ParserConfigurationException pce) {
/* 69 */       pce.printStackTrace();
/*    */     } catch (IOException ie) {
/* 71 */       ie.printStackTrace();
/*    */     }
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/html/XHtmlDefang.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */